package com.coc.bean;

import com.coc.bean.def.*;
import com.coc.bean.res.*;
import com.coc.bean.war.*;
import java.io.Serializable;
import java.util.*;

public class CcMap implements Serializable {
	private static final long serialVersionUID = 100000000001L;
	//private Integer[][] map = new Integer[42][42];
	private List<String> workings = new ArrayList<String>();
	private List<Long> workend = new ArrayList<Long>();
	private List<String> exping = new ArrayList<String>();
	private Integer uid;
	private Integer totalUnitSize = 0;
	private Integer totalTreeSize = 0;
	private CcUser ccuser;
	private List<Slav> slavs = new ArrayList<Slav>();
	private List<Wall> walls = new ArrayList<Wall>();
	private Hashtable<String, List<Tree>> trees = new Hashtable<String, List<Tree>>();
	private Hashtable<String, List<Dect>> dects = new Hashtable<String, List<Dect>>();
	private Cast cast = null;
	private Hall hall = null;
	private Labt labt = null;
	private Spel spel = null;
	private King king = null;
	private Quen quen = null;
	private List<Elxm> elxms = new ArrayList<Elxm>();
	private List<Golm> golms = new ArrayList<Golm>();
	private List<Dakm> dakms = new ArrayList<Dakm>();
	private List<Elxs> elxss = new ArrayList<Elxs>();
	private List<Gols> golss = new ArrayList<Gols>();
	private List<Daks> dakss = new ArrayList<Daks>();
	private List<Camp> camps = new ArrayList<Camp>();
	private List<Tran> barks = new ArrayList<Tran>();
	private List<Trdk> bkdks = new ArrayList<Trdk>();
	private List<Cann> canns = new ArrayList<Cann>();
	private List<Arct> arcts = new ArrayList<Arct>();
	private List<Wizt> wizts = new ArrayList<Wizt>();
	private List<Mort> morts = new ArrayList<Mort>();
	private List<Aird> airds = new ArrayList<Aird>();
	private List<Hide> tslas = new ArrayList<Hide>();
	private List<Xbow> xbows = new ArrayList<Xbow>();
	private List<Inft> infts = new ArrayList<Inft>();
	private List<Bomb> bombs = new ArrayList<Bomb>();
	private List<Trap> traps = new ArrayList<Trap>();
	private List<Gitb> gitbs = new ArrayList<Gitb>();
	private List<Airb> airbs = new ArrayList<Airb>();
	private List<Airm> airms = new ArrayList<Airm>();
	private String castlist = "";
	private String camplist = "";
	
	public void addWork(String type){
		if(workings==null){
			workings= new ArrayList<String>();
		}
		workings.add(type);
	}
	public void addWorkend(Long time){
		if(workend==null){
			workend= new ArrayList<Long>();
		}
		workend.add(time);
	}
	public Long getLastWorkend(){
		return workend.get(workend.size()-1);
	}
	public void addExping(String exp){
		if(exping==null){
			exping= new ArrayList<String>();
		}
		exping.add(exp);
	}
	public void removeWorkend(long time){
		int index = 0;
		for(int i=0;i<workend.size();i++){
			long l = workend.get(i);
			if(l==time){
				index=i;
			}
		}
		workings.remove(index);
		workend.remove(index);
		exping.remove(index);
	}
	public void resetWorkend(long time,long t){
		int index = 0;
		for(int i=0;i<workend.size();i++){
			long l = workend.get(i);
			if(l==time){
				index=i;
			}
		}
		workend.set(index,t);
	}
	public List<String> getWorkings() {
		return workings;
	}

	public void setWorkings(List<String> workings) {
		this.workings = workings;
	}

	public List<Long> getWorkend() {
		return workend;
	}

	public void setWorkend(List<Long> workend) {
		this.workend = workend;
	}

	public List<String> getExping() {
		return exping;
	}

	public void setExping(List<String> exping) {
		this.exping = exping;
	}

	public Hashtable<String, List<Dect>> getDects() {
		return dects;
	}

	public void setDects(Hashtable<String, List<Dect>> dects) {
		this.dects = dects;
	}

	public Integer getTotalUnitSize() {
		return totalUnitSize;
	}

	public void setTotalUnitSize(Integer totalUnitSize) {
		this.totalUnitSize = totalUnitSize;
	}

	public Integer getTotalTreeSize() {
		return totalTreeSize;
	}

	public void setTotalTreeSize(Integer totalTreeSize) {
		this.totalTreeSize = totalTreeSize;
	}

	

//	public Integer[][] getMap() {
//		return this.map;
//	}
//
//	public void setMap(Integer[][] map) {
//		this.map = map;
//	}

	public List<Trap> getTraps() {
		return this.traps;
	}

	public void setTraps(List<Trap> traps) {
		this.traps = traps;
	}

	public List<Gitb> getGitbs() {
		return this.gitbs;
	}

	public void setGitbs(List<Gitb> gitbs) {
		this.gitbs = gitbs;
	}

	public List<Airb> getAirbs() {
		return this.airbs;
	}

	public void setAirbs(List<Airb> airbs) {
		this.airbs = airbs;
	}

	public List<Airm> getAirms() {
		return this.airms;
	}

	public void setAirms(List<Airm> airms) {
		this.airms = airms;
	}

	public List<Inft> getInfts() {
		return this.infts;
	}

	public void setInfts(List<Inft> infts) {
		this.infts = infts;
	}

	public String getCastlist() {
		return this.castlist;
	}

	public void setCastlist(String castlist) {
		this.castlist = castlist;
	}

	public String getCamplist() {
		return this.camplist;
	}

	public void setCamplist(String camplist) {
		this.camplist = camplist;
	}

	public Integer getUid() {
		return this.uid;
	}

	public void setUid(Integer uid) {
		this.uid = uid;
	}

	public List<Wall> getWalls() {
		return this.walls;
	}

	public void setWalls(List<Wall> walls) {
		this.walls = walls;
	}

	public Hashtable<String, List<Tree>> getTrees() {
		return trees;
	}

	public void setTrees(Hashtable<String, List<Tree>> trees) {
		this.trees = trees;
	}

	public List<Slav> getSlavs() {
		return this.slavs;
	}

	public void setSlavs(List<Slav> slavs) {
		this.slavs = slavs;
	}

	public Cast getCast() {
		return this.cast;
	}

	public void setCast(Cast cast) {
		this.cast = cast;
	}

	public Hall getHall() {
		return this.hall;
	}

	public void setHall(Hall hall) {
		this.hall = hall;
	}

	public Labt getLabt() {
		return this.labt;
	}

	public void setLabt(Labt labt) {
		this.labt = labt;
	}

	public Spel getSpel() {
		return this.spel;
	}

	public void setSpel(Spel spel) {
		this.spel = spel;
	}

	public King getKing() {
		return this.king;
	}

	public void setKing(King king) {
		this.king = king;
	}

	public Quen getQuen() {
		return this.quen;
	}

	public void setQuen(Quen quen) {
		this.quen = quen;
	}

	public List<Elxm> getElxms() {
		return this.elxms;
	}

	public void setElxms(List<Elxm> elxms) {
		this.elxms = elxms;
	}

	public List<Golm> getGolms() {
		return this.golms;
	}

	public void setGolms(List<Golm> golms) {
		this.golms = golms;
	}

	public List<Dakm> getDakms() {
		return this.dakms;
	}

	public void setDakms(List<Dakm> dakms) {
		this.dakms = dakms;
	}

	public List<Elxs> getElxss() {
		return this.elxss;
	}

	public void setElxss(List<Elxs> elxss) {
		this.elxss = elxss;
	}

	public List<Gols> getGolss() {
		return this.golss;
	}

	public void setGolss(List<Gols> golss) {
		this.golss = golss;
	}

	public List<Daks> getDakss() {
		return this.dakss;
	}

	public void setDakss(List<Daks> dakss) {
		this.dakss = dakss;
	}

	public List<Camp> getCamps() {
		return this.camps;
	}

	public void setCamps(List<Camp> camps) {
		this.camps = camps;
	}

	public List<Tran> getBarks() {
		return this.barks;
	}

	public void setBarks(List<Tran> barks) {
		this.barks = barks;
	}

	public List<Trdk> getBkdks() {
		return this.bkdks;
	}

	public void setBkdks(List<Trdk> bkdks) {
		this.bkdks = bkdks;
	}

	public List<Hide> getTslas() {
		return this.tslas;
	}

	public void setTslas(List<Hide> tslas) {
		this.tslas = tslas;
	}

	public List<Cann> getCanns() {
		return this.canns;
	}

	public void setCanns(List<Cann> canns) {
		this.canns = canns;
	}

	public List<Arct> getArcts() {
		return this.arcts;
	}

	public void setArcts(List<Arct> arcts) {
		this.arcts = arcts;
	}

	public List<Wizt> getWizts() {
		return this.wizts;
	}

	public void setWizts(List<Wizt> wizts) {
		this.wizts = wizts;
	}

	public List<Mort> getMorts() {
		return this.morts;
	}

	public void setMorts(List<Mort> morts) {
		this.morts = morts;
	}

	public List<Aird> getAirds() {
		return this.airds;
	}

	public void setAirds(List<Aird> airds) {
		this.airds = airds;
	}

	public List<Xbow> getXbows() {
		return this.xbows;
	}

	public void setXbows(List<Xbow> xbows) {
		this.xbows = xbows;
	}

	public List<Bomb> getBombs() {
		return this.bombs;
	}

	public void setBombs(List<Bomb> bombs) {
		this.bombs = bombs;
	}

	public CcUser getCcuser() {
		return this.ccuser;
	}

	public void setCcuser(CcUser ccuser) {
		this.ccuser = ccuser;
	}

	private String getUserString() {
		StringBuffer sbf = new StringBuffer("\"user\":\"" + this.ccuser.getId()
				+ "," + this.ccuser.getSnsname() + "," + this.ccuser.getCup()
				+ "," + this.ccuser.getLv() + "|" + this.ccuser.getExp() + ","
				+ this.ccuser.getGold() + "|" + this.ccuser.getElixir() + "|"
				+ this.ccuser.getDark() + "\"");
		return sbf.toString();
	}

	private String getUser2String() {
		StringBuffer sbf = new StringBuffer("\"user2\":{\"qqp\":\""
				+ this.ccuser.getQqp() + "\",\"gem\":\"" + this.ccuser.getGem()
				+ "\",\"shield\":\"" + this.ccuser.getSavetime() + ","
				+ this.ccuser.getSavecooldown() + "\"}");
		return sbf.toString();
	}

	private String getMap2CampString() {
		StringBuffer sbf = new StringBuffer("\"map2\":{");
		sbf.append("\"CAMP\":\"" + this.camplist + "\"");
		sbf.append("}");
		return sbf.toString();
	}

	private String getMap2CastString() {
		StringBuffer sbf = new StringBuffer("\"map2\":{");
		sbf.append("\"CAST\":\"" + this.castlist + "\"");
		sbf.append("}");
		return sbf.toString();
	}

	private String getMap2AllString() {
		StringBuffer sbf = new StringBuffer("\"map2\":{");
		sbf.append("\"CAMP\":\"" + this.camplist + "\"");
		sbf.append(",\"CAST\":\"" + this.castlist + "\"");
		String bark = "";
		String bkdk = "";
		String labts = "";
		String spels = "";
		// 训练当前这个单位开始的时间, 兵种id|数量, 兵种id|数量,......",
		if ((this.barks != null) && (this.barks.size() > 0)) {
			for (int i = 0; i < this.barks.size(); i++) {
				Tran tmp = (Tran) this.barks.get(i);
				if (i != 0) {
					bark = bark + ",";
				}
				if (tmp.getProcessbeg() == 0) {
					bark = bark + "\"\"";
				} else {
					bark = bark + "\"" + tmp.getProcessbeg() + ","
							+ tmp.getProcess() + "\"";
				}

			}
		}
		sbf.append(",\"BARK\":[" + bark + "]");
		if ((this.bkdks != null) && (this.bkdks.size() > 0)) {
			for (int i = 0; i < this.bkdks.size(); i++) {
				Trdk tmp = (Trdk) this.bkdks.get(i);
				if (i != 0) {
					bkdk = bkdk + ",";
				}
				if (tmp.getProcessbeg() == 0) {
					bkdk = bkdk + "\"\"";
				} else {
					bkdk = bkdk + "\"" + tmp.getProcessbeg() + ","
							+ tmp.getProcess() + "\"";
				}

			}
		}
		sbf.append(",\"BKDK\":[" + bkdk + "]");
		if (this.labt != null) {
			labts = "\"ing\":\"" + this.labt.getResearching()+","+this.labt.getResearchbeg()
					+ "\",\"ready\":\"" + this.labt.getDone() + "\"";
		}
		sbf.append(",\"LABT\":\"" + labts + "\"");
		if (this.spel != null) {
			spels = "\"ing\":\"" + this.spel.getResearching()
					+ "\",\"ready\":\"" + this.spel.getCurspell() + "\"";
		}
		sbf.append(",\"SPEL\":\"" + spels + "\"");

		sbf.append("}");
		return sbf.toString();
	}

	private String getMapString() {
		StringBuffer sbf = new StringBuffer("\"map\":{");

		String dects = "";
		if (this.dects != null) {
			for (Iterator<String> it = this.dects.keySet().iterator(); it.hasNext();) {
				// 从ht中取
				String key = it.next();
				List<Dect> value = this.dects.get(key);
				// 放进hm中
				dects = dects + ",\"" + key + "\":[";
				for (int i = 0; i < value.size(); i++) {
					Dect tmp = value.get(i);
					if (i != 0) {
						dects = dects + ",";
					}
					dects = dects + "\"" + tmp.getX() + "," + tmp.getY() + "\"";
				}
				dects = dects + "]";
			}

		}
		if (dects.startsWith(",")) {
			dects = dects.substring(1);
		}
		sbf.append(dects);
		String trees = "";
		if (this.trees != null) {
			for (Iterator<String> it = this.trees.keySet().iterator(); it.hasNext();) {
				// 从ht中取
				String key =  it.next();
				List<Tree> value = this.trees.get(key);
				// 放进hm中
				trees = trees + ",\"" + key + "\":[";
				for (int i = 0; i < value.size(); i++) {
					Tree tmp = value.get(i);
					if (i != 0) {
						trees = trees + ",";
					}
					trees = trees + "\"" + tmp.getX() + "," + tmp.getY() + "\"";
				}
				trees = trees + "]";
			}

		}
		if (trees.startsWith(",")) {
			trees = trees.substring(1);
		}
		sbf.append(trees);

		String wall = "";
		if ((this.walls != null) && (this.walls.size() > 0)) {
			for (int i = 0; i < this.walls.size(); i++) {
				Wall tmp = (Wall) this.walls.get(i);
				if (i != 0) {
					wall = wall + ",";
				}
				wall = wall + "\"" + tmp.getX() + "," + tmp.getY() + ","
						+ tmp.getLv() + "\"";
			}
		}
		sbf.append(",\"WALL\":[" + wall + "]");

		String slav = "";
		if ((this.slavs != null) && (this.slavs.size() > 0)) {
			for (int i = 0; i < this.slavs.size(); i++) {
				Slav tmp = (Slav) this.slavs.get(i);
				if (i != 0) {
					slav = slav + ",";
				}
				slav = slav + "\"" + tmp.getX() + "," + tmp.getY() + "\"";
			}
		}
		sbf.append(",\"SLAV\":[" + slav + "]");

		String tmpstr = "";
		if (this.cast != null) {
			tmpstr = this.cast.getX() + "," + this.cast.getY() + ","
					+ this.cast.getLv() + "," + this.cast.getUpgradeEnd() + ","
					+ this.cast.getCastid() + "," + this.cast.getName() + ","
					+ this.cast.getIcon();
		}
		sbf.append(",\"CAST\":\"" + tmpstr + "\"");

		tmpstr = "";
		if (this.hall != null) {
			tmpstr = this.hall.getX() + "," + this.hall.getY() + ","
					+ this.hall.getLv() + "," + this.hall.getUpgradeEnd();
		}
		sbf.append(",\"HALL\":\"" + tmpstr + "\"");

		tmpstr = "";
		if (this.labt != null) {
			tmpstr = this.labt.getX() + "," + this.labt.getY() + ","
					+ this.labt.getLv() + "," + this.labt.getUpgradeEnd();
		}
		sbf.append(",\"LABT\":\"" + tmpstr + "\"");

		tmpstr = "";
		if (this.spel != null) {
			tmpstr = this.spel.getX() + "," + this.spel.getY() + ","
					+ this.spel.getLv() + "," + this.spel.getUpgradeEnd();
		}
		sbf.append(",\"SPEL\":\"" + tmpstr + "\"");

		tmpstr = "";
		if (this.king != null) {
			tmpstr = this.king.getX() + "," + this.king.getY() + ","
					+ this.king.getLv() + "," + this.king.getUpgradeEnd() + ","
					+ this.king.getRenew();
		}
		sbf.append(",\"KING\":\"" + tmpstr + "\"");

		if (this.quen != null) {
			tmpstr = this.quen.getX() + "," + this.quen.getY() + ","
					+ this.quen.getLv() + "," + this.quen.getUpgradeEnd() + ","
					+ this.quen.getRenew();
		}
		sbf.append(",\"QUEN\":\"" + tmpstr + "\"");

		String elxm = "";
		String elxs = "";
		String golm = "";
		String gols = "";
		String dakm = "";
		String daks = "";
		// x,y,lv,升级开始时刻,暂存资源清零时刻,boost到期时间
		if ((this.elxms != null) && (this.elxms.size() > 0)) {
			for (int i = 0; i < this.elxms.size(); i++) {
				Elxm tmp = (Elxm) this.elxms.get(i);
				if (i != 0) {
					elxm = elxm + ",";
				}
				elxm = elxm + "\"" + tmp.getX() + "," + tmp.getY() + ","
						+ tmp.getLv() + "," + tmp.getUpgradeEnd() + ","
						+ tmp.getLefttime() + "," + tmp.getBoosttime2() + "\"";
			}
		}
		if ((this.golms != null) && (this.golms.size() > 0)) {
			for (int i = 0; i < this.golms.size(); i++) {
				Golm tmp = (Golm) this.golms.get(i);
				if (i != 0) {
					golm = golm + ",";
				}
				golm = golm + "\"" + tmp.getX() + "," + tmp.getY() + ","
						+ tmp.getLv() + "," + tmp.getUpgradeEnd() + ","
						+ tmp.getLefttime() + "," + tmp.getBoosttime2() + "\"";
			}
		}
		if ((this.dakms != null) && (this.dakms.size() > 0)) {
			for (int i = 0; i < this.dakms.size(); i++) {
				Dakm tmp = (Dakm) this.dakms.get(i);
				if (i != 0) {
					dakm = dakm + ",";
				}
				dakm = dakm + "\"" + tmp.getX() + "," + tmp.getY() + ","
						+ tmp.getLv() + "," + tmp.getUpgradeEnd() + ","
						+ tmp.getLefttime() + "," + tmp.getBoosttime2() + "\"";
			}
		}
		if ((this.elxss != null) && (this.elxss.size() > 0)) {
			for (int i = 0; i < this.elxss.size(); i++) {
				Elxs tmp = (Elxs) this.elxss.get(i);
				if (i != 0) {
					elxs = elxs + ",";
				}
				elxs = elxs + "\"" + tmp.getX() + "," + tmp.getY() + ","
						+ tmp.getLv() + "," + tmp.getUpgradeEnd() + "\"";
			}
		}
		if ((this.golss != null) && (this.golss.size() > 0)) {
			for (int i = 0; i < this.golss.size(); i++) {
				Gols tmp = (Gols) this.golss.get(i);
				if (i != 0) {
					gols = gols + ",";
				}
				gols = gols + "\"" + tmp.getX() + "," + tmp.getY() + ","
						+ tmp.getLv() + "," + tmp.getUpgradeEnd() + "\"";
			}
		}
		if ((this.dakss != null) && (this.dakss.size() > 0)) {
			for (int i = 0; i < this.dakss.size(); i++) {
				Daks tmp = (Daks) this.dakss.get(i);
				if (i != 0) {
					daks = daks + ",";
				}
				daks = daks + "\"" + tmp.getX() + "," + tmp.getY() + ","
						+ tmp.getLv() + "," + tmp.getUpgradeEnd() + "\"";
			}
		}
		sbf.append(",\"ELXM\":[" + elxm + "],\"ELXS\":[" + elxs
				+ "],\"GOLM\":[" + golm + "],\"GOLS\":[" + gols
				+ "],\"DAKM\":[" + dakm + "],\"DAKS\":[" + daks + "]");

		String bark = "";
		String bkdk = "";
		String camp = "";
		if ((this.barks != null) && (this.barks.size() > 0)) {
			for (int i = 0; i < this.barks.size(); i++) {
				Tran tmp = (Tran) this.barks.get(i);
				if (i != 0) {
					bark = bark + ",";
				}
				bark = bark + "\"" + tmp.getX() + "," + tmp.getY() + ","
						+ tmp.getLv() + "," + tmp.getUpgradeEnd() + "\"";
			}
		}
		if ((this.bkdks != null) && (this.bkdks.size() > 0)) {
			for (int i = 0; i < this.bkdks.size(); i++) {
				Trdk tmp = (Trdk) this.bkdks.get(i);
				if (i != 0) {
					bkdk = bkdk + ",";
				}
				bkdk = bkdk + "\"" + tmp.getX() + "," + tmp.getY() + ","
						+ tmp.getLv() + "," + tmp.getUpgradeEnd() + "\"";
			}
		}
		if ((this.camps != null) && (this.camps.size() > 0)) {
			for (int i = 0; i < this.camps.size(); i++) {
				Camp tmp = (Camp) this.camps.get(i);
				if (i != 0) {
					camp = camp + ",";
				}
				camp = camp + "\"" + tmp.getX() + "," + tmp.getY() + ","
						+ tmp.getLv() + "," + tmp.getUpgradeEnd() + "\"";
			}
		}
		sbf.append(",\"BARK\":[" + bark + "],\"BKDK\":[" + bkdk
				+ "],\"CAMP\":[" + camp + "]");

		String cann = "";
		String arct = "";
		String mort = "";
		String aird = "";
		String wizt = "";
		String tsla = "";
		String xbow = "";
		String inft = "";
		String bomb = "";
		String trap = "";
		String gitb = "";
		String airb = "";
		String airm = "";
		if ((this.canns != null) && (this.canns.size() > 0)) {
			for (int i = 0; i < this.canns.size(); i++) {
				Cann tmp = (Cann) this.canns.get(i);
				if (i != 0) {
					cann = cann + ",";
				}
				cann = cann + "\"" + tmp.getX() + "," + tmp.getY() + ","
						+ tmp.getLv() + "," + tmp.getUpgradeEnd() + "\"";
			}
		}
		if ((this.arcts != null) && (this.arcts.size() > 0)) {
			for (int i = 0; i < this.arcts.size(); i++) {
				Arct tmp = (Arct) this.arcts.get(i);
				if (i != 0) {
					arct = arct + ",";
				}
				arct = arct + "\"" + tmp.getX() + "," + tmp.getY() + ","
						+ tmp.getLv() + "," + tmp.getUpgradeEnd() + "\"";
			}
		}
		if ((this.wizts != null) && (this.wizts.size() > 0)) {
			for (int i = 0; i < this.wizts.size(); i++) {
				Wizt tmp = (Wizt) this.wizts.get(i);
				if (i != 0) {
					arct = arct + ",";
				}
				wizt = wizt + "\"" + tmp.getX() + "," + tmp.getY() + ","
						+ tmp.getLv() + "," + tmp.getUpgradeEnd() + "\"";
			}
		}
		if ((this.morts != null) && (this.morts.size() > 0)) {
			for (int i = 0; i < this.morts.size(); i++) {
				Mort tmp = (Mort) this.morts.get(i);
				if (i != 0) {
					mort = mort + ",";
				}
				mort = mort + "\"" + tmp.getX() + "," + tmp.getY() + ","
						+ tmp.getLv() + "," + tmp.getUpgradeEnd() + "\"";
			}
		}
		if ((this.airds != null) && (this.airds.size() > 0)) {
			for (int i = 0; i < this.airds.size(); i++) {
				Aird tmp = (Aird) this.airds.get(i);
				if (i != 0) {
					aird = aird + ",";
				}
				aird = aird + "\"" + tmp.getX() + "," + tmp.getY() + ","
						+ tmp.getLv() + "," + tmp.getUpgradeEnd() + "\"";
			}
		}
		if ((this.tslas != null) && (this.tslas.size() > 0)) {
			for (int i = 0; i < this.tslas.size(); i++) {
				Hide tmp = (Hide) this.tslas.get(i);
				if (i != 0) {
					tsla = tsla + ",";
				}
				tsla = tsla + "\"" + tmp.getX() + "," + tmp.getY() + ","
						+ tmp.getLv() + "," + tmp.getUpgradeEnd() + "\"";
			}
		}
		if ((this.xbows != null) && (this.xbows.size() > 0)) {
			for (int i = 0; i < this.xbows.size(); i++) {
				Xbow tmp = (Xbow) this.xbows.get(i);
				if (i != 0) {
					xbow = xbow + ",";
				}
				xbow = xbow + "\"" + tmp.getX() + "," + tmp.getY() + ","
						+ tmp.getLv() + "," + tmp.getUpgradeEnd() + "\"";
			}
		}
		if ((this.infts != null) && (this.infts.size() > 0)) {
			for (int i = 0; i < this.infts.size(); i++) {
				Inft tmp = (Inft) this.infts.get(i);
				if (i != 0) {
					inft = inft + ",";
				}
				inft = inft + "\"" + tmp.getX() + "," + tmp.getY() + ","
						+ tmp.getLv() + "," + tmp.getUpgradeEnd() + "\"";
			}
		}
		if ((this.bombs != null) && (this.bombs.size() > 0)) {
			for (int i = 0; i < this.bombs.size(); i++) {
				Bomb tmp = (Bomb) this.bombs.get(i);
				if (i != 0) {
					bomb = bomb + ",";
				}
				bomb = bomb + "\"" + tmp.getX() + "," + tmp.getY() + "\"";
			}
		}
		if ((this.traps != null) && (this.traps.size() > 0)) {
			for (int i = 0; i < this.traps.size(); i++) {
				Trap tmp = (Trap) this.traps.get(i);
				if (i != 0) {
					trap = trap + ",";
				}
				trap = trap + "\"" + tmp.getX() + "," + tmp.getY() + "\"";
			}
		}
		if ((this.gitbs != null) && (this.gitbs.size() > 0)) {
			for (int i = 0; i < this.gitbs.size(); i++) {
				Gitb tmp = (Gitb) this.gitbs.get(i);
				if (i != 0) {
					gitb = gitb + ",";
				}
				gitb = gitb + "\"" + tmp.getX() + "," + tmp.getY() + "\"";
			}
		}
		if ((this.airbs != null) && (this.airbs.size() > 0)) {
			for (int i = 0; i < this.airbs.size(); i++) {
				Airb tmp = (Airb) this.airbs.get(i);
				if (i != 0) {
					airb = airb + ",";
				}
				airb = airb + "\"" + tmp.getX() + "," + tmp.getY() + "\"";
			}
		}
		if ((this.airms != null) && (this.airms.size() > 0)) {
			for (int i = 0; i < this.airms.size(); i++) {
				Airm tmp = (Airm) this.airms.get(i);
				if (i != 0) {
					airm = airm + ",";
				}
				airm = airm + "\"" + tmp.getX() + "," + tmp.getY() + "\"";
			}
		}
		sbf.append(",\"CANN\":[" + cann + "],\"ARCT\":[" + arct
				+ "],\"MORT\":[" + mort + "],\"AIRD\":[" + aird
				+ "],\"WIZT\":[" + wizt + "],\"TSLA\":[" + tsla
				+ "],\"XBOW\":[" + xbow + "],\"INFT\":[" + inft
				+ "],\"BOMB\":[" + bomb + "],\"TRAP\":[" + trap
				+ "],\"GITB\":[" + gitb + "],\"AIRB\":[" + airb
				+ "],\"AIRM\":[" + airm + "]");

		sbf.append("}");
		return sbf.toString();
	}

	public String toString() {
		StringBuffer sbf = new StringBuffer("");
		sbf.append("\"time_s\":" + System.currentTimeMillis());
		sbf.append("," + getUserString());
		sbf.append("," + getUser2String());
		sbf.append("," + getMapString());
		sbf.append("," + getMap2AllString());
		sbf.append("");
		return sbf.toString();
	}

	// 全局初始化
//	public void initMap() {
//		for (int i = 0; i < map.length; i++) {// 遍历纵向的数据
//			for (int j = 0; j < map[i].length; j++) {// 遍历横向的数据
//				if (i == 0 || i == 41 || j == 0 || j == 41) {
//					map[i][j] = 2;
//				} else {
//					map[i][j] = 0;
//				}
//
//			}
//		}
//	}

	// 历史数据加上边缘.同时把建筑物占位添加
//	public void initMap2() {
//		int total = 0;
//		Integer[][] newmap = new Integer[42][42];
//		for (int i = 0; i < newmap.length; i++) {// 遍历纵向的数据
//			for (int j = 0; j < newmap[i].length; j++) {// 遍历横向的数据
//				if (newmap[i][j] != null && newmap[i][j] > 0) {
//					total++;
//				}
//				if (i == 0 || i == 41 || j == 0 || j == 41) {
//					newmap[i][j] = 2;
//				} else {
//					newmap[i][j] = map[i - 1][j - 1];
//				}
//
//			}
//		}
//		this.map = newmap;
//		this.totalUnitSize = total;
//		this.totalTreeSize = 0;
//	}
}

/*
 * Location: C:\Work\WorkSpace\classes\ Qualified Name: com.coc.bean.CcMap
 * JD-Core Version: 0.6.2
 */